<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <head>
        <title><ui:insert name="title">Page's title goes here</ui:insert> - TaskManager</title>
        <ui:insert name="head" >
            <!--[Specific css, scripts, ...]-->
        </ui:insert>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="shortcut icon" href="" />
        <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/css/site.css" />
        <script type="text/javascript" src="#{request.contextPath}/resources/scripts/utils.js"></script>

        <c:if test='#{request.requestURL.toString().contains("/admin/")}'>
            <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/css/admin.css" />
        </c:if>
    </head>
    <body>
        <div class="page">
            <div style="position: relative; text-align: center;">
                <div id="ui-message"></div>
            </div>
            <header>
                <ui:insert name="header">
                    <c:choose>
                        <c:when test='#{baseBean.authenticatedUser.roleName == "USER"}'>
                            <ui:include src="headerAuthenticated.xhtml" />
                        </c:when>
                        <c:when test='#{baseBean.authenticatedUser.roleName == "ADMIN"}'>
                            <ui:include src="headerAuthenticated.xhtml" />
                        </c:when>
                        <c:otherwise>
                            <ui:include src="headerAnonymous.xhtml" />
                        </c:otherwise>
                    </c:choose>
                </ui:insert>
            </header>
            <ui:insert name="content">
                [insert the main section here]
            </ui:insert>
            <footer>
                <ul>
                    <li>
                        <a href="#{request.contextPath}/faces/index.xhtml">Home</a>
                    </li>
                    <li>
                        <a>About</a>
                    </li>
                    <li>
                        <a>Help</a>
                    </li>
                    <li>
                        <a>Terms</a>
                    </li>
                    <li>
                        <a>Florent &amp; Thomas</a>
                    </li>
                    <li>
                        <a>&copy; 2014</a>
                    </li>
                </ul>
            </footer>
        </div>
    </body>
</html>

